#include <stdint.h>
#include <sys/types.h>

#include <utils/RefBase.h>
#include <utils/Errors.h>

#include <binder/IInterface.h>

namespace android {
	// ----------------------------------------------------------------------------

	class IMyBinder : public IInterface
	{
		public:
			DECLARE_META_INTERFACE(MyBinder);
	};

	// ----------------------------------------------------------------------------

	class BnMyBinder : public BnInterface<IMyBinder>
	{
		public:
			virtual status_t    onTransact( uint32_t code,
					const Parcel& data,
					Parcel* reply,
					uint32_t flags = 0);
	};

	// ----------------------------------------------------------------------------

};

namespace android {

	class BpMyBinder : public BpInterface<IMyBinder>
	{
		public:
			BpMyBinder(const sp<IBinder>& impl)
				: BpInterface<IMyBinder>(impl)
			{
			}
	};

	IMPLEMENT_META_INTERFACE(MyBinder, "demo.IMyBinder");

	status_t BnMyBinder::onTransact(
			uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
	{
		switch(code) {

			default:
				return BBinder::onTransact(code, data, reply, flags);
		}
	}

}; // namespace android
